home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Scene Storm
/
Scene Storm - Volume 1.iso
/
coding
/
asm
/
games
/
spritegrabber
/
grabber
/
routines.s
< prev
next >
Wrap
Text File
|
1980-01-03
|
9KB
|
424 lines
exit_grabber
bsr do_icon
move.w #1,exit_proggy
return rts
;---------------------------------------------
load_iff bsr do_icon
lea loadifftxt,a0
lea do_iff_file,a1
lea iffonlytxt,a2
bsr load_file
rts
;---------------------------------------------
do_iff_file
bsr free_iff_file
bsr free_mask_screen
move.l file_address,iff_address
move.l file_length,iff_length
bsr check_iff_lbm_file
tst.w status_mode
bne.s .out
bsr get_iff_size
tst.w status_mode
bne.s .out
bsr decode_iff
bsr checkflags
bsr set_iff_screen
bsr do_iff_palette
bsr create_iff_table
bsr create_mask_screen
bsr alloc_palette
bsr print_screen_size
bsr init_grab_box
move.l #0,screenXpos
move.l #0,screenYpos
bsr set_iff_screen
add.w #1,iff_number
.out rts
;---------------------------------------------
mouse_box tst.w box_start
bne .next_part
btst #6,$bfe001
bne .out
moveq.l #0,d0
move.b ypos,d0
cmp.w #200,d0
bge .out
move.w xpos,d0
moveq.l #0,d1
move.b ypos,d1
move.w d0,box_x
move.w d1,box_y
addq.w #2,d0
addq.w #2,d1
move.w d0,box_x1
move.w d1,box_y1
bsr draw_grab_box
move.w #1,box_start
.out bra .right
.next_part btst #6,$Bfe001
bne.s .out2
moveq.l #0,d0
move.b ypos,d0
cmp.w #200,d0
bgt.s .out1
move.w xpos,d0
moveq.l #0,d1
move.b ypos,d1
sub.w #1,d0
sub.w #1,d1
cmp.w box_x,d0
ble.s .out1
cmp.w box_y,d1
ble.s .out1
add.w #1,d0
add.w #1,d1
move.w d0,box_x1
move.w d1,box_y1
bsr draw_grab_box
.out1 rts
.out2 bsr draw_grab_box
move.w #0,box_start
move.w #0,status_mode
bsr do_box_check
bsr do_status
tst.w status_mode
bne.s .outy
.right bsr check_rightmouse
.outy rts
;---------------------------------------------
mouse_detection
bsr do_mouse_detect
bsr check_rightmouse
rts
;---------------------------------------------
check_rightmouse
btst #10,$dff016
beq.s .okay
rts
.okay btst #10,$dff016
beq.s .okay
cmp.w #1,box_on
beq.s .cut
rts
.cut
grab_spritey
bsr alloc_cut_sprite
tst.l d7
bmi.s .error
bsr undraw_grab_box
bsr grab_sprite
add.w #1,sprite_amount
bsr print_sprite_amount
move.w #14,status_mode
;; bsr draw_grab_box
.error bsr waitframe
bsr do_status
rts
;---------------------------------------------
screen_proc
moveq.l #0,d0
move.b keycode,d0
.movescreendown
cmp.b #'d',d0
bne.s .movescreenup
move.l iff_height,d0
sub.l #198,d0
bmi.s .out
beq.s .out
move.l iff_height,d0
subq.l #1,d0
move.l screenYpos,d1
add.l #198,d1
sub.l d1,d0
bmi.s .out
add.l #1,screenYpos
bsr set_iff_screen
.out rts
;---------------------------------------------
.movescreenup
cmp.b #'a',d0
bne.s .movescreenright
cmp.l #0,screenYpos
beq.s .out2
sub.l #1,screenYpos
bsr set_iff_screen
.out2 rts
;---------------------------------------------
.movescreenright
cmp.b #'c',d0
bne.s .movescreenleft
move.l iff_width,d0
sub.l #40,d0
move.l screenXpos,d1
sub.l d1,d0
bmi.s .out3
beq.s .out3
addq.l #2,d1
move.l d1,screenXpos
bsr set_iff_screen
.out3 rts
;---------------------------------------------
.movescreenleft
cmp.b #'b',d0
bne.s .out4
cmp.l #0,screenXpos
beq.s .out4
subq.l #2,screenXpos
bsr set_iff_screen
.out4 rts
;---------------------------------------------
edit_sprites_routine
bsr do_icon
bsr set_edit_menu
rts
;---------------------------------------------
save_generic_sprites
bsr do_icon
lea save_generic_txt,a0
lea save_gensprites,a1
lea genonlytxt,a2
bsr save_file
rts
;---------------------------------------------
grab_sprite_routine
bsr do_icon
bsr grab_spritey
rts
;---------------------------------------------
delete_sprite_routine
bsr do_icon
bsr undraw_grab_box
bsr reprint_sprite
;; bsr draw_grab_box
bsr do_status
bsr print_sprite_amount
rts
;---------------------------------------------
print_avail_memory
moveq.l #0,d0
move.l #$00002,d1
LIB availmem,exec
move.l d0,chipmem
moveq.l #0,d0
move.l #$00004,d1
LIB availmem,exec
move.l d0,fastmem
move.l #1,tcol
move.l #25,d0
move.l #38,d1
move.l chipmem,d2
moveq.l #8,d3
bsr dec_print
move.l #25,d0
move.l #46,d1
move.l fastmem,d2
moveq.l #8,d3
bsr dec_print
rts
;---------------------------------------------
exit_palette_editor
bsr do_icon
bsr set_edit_menu
rts
;---------------------------------------------
exit_editor_routine
bsr do_icon
bsr set_main_menu
rts
;---------------------------------------------
load_generic_sprites
bsr do_icon
move.l #loadgentxt,filefix1
move.l #genonlytxt,a0
bsr copy_reqshow
bsr do_blank_status
bsr reset_system
move.w #FRQABSOLUTEXYM!FRQLOADINGM,loadsave
lea Filereq,a0
LIB filerequester,req
tst.l d0
beq .error
move.w #0,status_mode
bsr load_stuff
;---------------------------------------------
move.l #4,file_length ; check header of file
move.l #testhead,file_address
bsr read_stuff2
cmp.l #'TOSH',testhead
bne .error2
;---------------------------------------------
bsr free_palettelist_generic ; free old sprites palettes
bsr free_sprite_list_generic
;---------------------------------------------
move.l #4,file_length ; get sprite palettes
move.l #genstuff,file_address ; from gen
bsr read_stuff2
move.w genstuff,sprite_amount
move.w genstuff+2,palettes
;---------------------------------------------
moveq.l #0,d0 ; alloc temp gen header
move.w sprite_amount,d0
lsl.w #2,d0
move.l d0,genlength
move.l #$10001,d1
LIB allocmem,exec
move.l d0,genaddress
move.l genlength,file_length
move.l genaddress,file_address
bsr read_stuff2
;---------------------------------------------
move.w palettes,d7
subq.w #1,d7
bmi.s .nopals
.loop move.l d7,-(sp)
bsr find_free_palettelist
movem.l (sp)+,d7
move.l #$300,d0
move.l #$10001,d1
LIB allocmem,exec
move.l d0,(a6)
move.l #-1,4(a6)
move.l d0,file_address
move.l #$300,file_length
movem.l d0-d7/a0-a6,-(sp)
bsr read_stuff2
movem.l (sp)+,d0-d7/a0-a6
dbra d7,.loop
;---------------------------------------------
.nopals move.w sprite_amount,d7
subq.w #1,d7
bmi.s .nospr
move.l genaddress,a5
.loop1 move.l d7,-(sp)
bsr find_free_spritelist
move.l d7,d6
move.l (sp)+,d7
tst.l d6
bmi .error3
move.l (a5)+,d0
move.l d0,file_length
move.l #$10001,d1
LIB allocmem,exec
move.l d0,file_address
move.l d0,(a6)
move.l #-1,4(a6)
movem.l d0-d7/a0-a6,-(sp)
bsr read_stuff2
movem.l (sp)+,d0-d7/a0-a6
dbra d7,.loop1
;---------------------------------------------
.error3
.nospr move.l genaddress,a1 ; free gen header
move.l genlength,d0
LIB freemem,exec
bsr close_stuff
bra.s .take
;---------------------------------------------
.error2 move.w #20,status_mode ; not a gen file
bsr close_stuff
bra.s .take
.error move.w #1,status_mode ; no file selected
;---------------------------------------------
.take bsr do_status
bsr takeback_system
move.w #0,actual_edit
move.l palette_list,a0
move.l (a0),a0
bsr do_palette
move.w #0,editA
bsr print_editor_sprites
rts
testhead dc.b 0,0,0,0,0,0
genstuff dc.l 0,0
;---------------------------------------------
save_new_sprites
bsr do_icon
bsr save_new_sprites_routine
cmp.w #6,gfxmode
bge.s .sat
lea spronlytxt,a2
bra save_file
.sat lea satonlytxt,a2
bra save_file_mode
satonlytxt dc.b '#?',0
even
;---------------------------------------------
save_new_sprites_routine
move.w gfxmode,d0
lea save_modes_table,a1
lea save_modes_text,a0
move.l (a0,d0.w*4),a0
move.l (a1,d0.w*4),a1
rts
save_modes_text
dc.l save_amiga_planes_txt
dc.l save_amiga_interleaved_txt
dc.l save_copper_txt
dc.l save_pixel_txt
dc.l save_genesis_txt
dc.l save_genesis_txt2
dc.l save_saturn_256_txt
dc.l save_saturn_128_txt
dc.l save_saturn_64_txt
dc.l save_saturn_16_txt
dc.l save_saturn_bgr_txt
dc.l Save_Saturn_Chr8_txt
dc.l Save_Saturn_Chr16_txt
save_modes_table
dc.l save_amiga_plane_format ; planes
dc.l save_amiga_interleaved_format ; interleaved
dc.l save_amiga_copper_format ; copper
dc.l save_bytepixel_format ; byte pixel
dc.l create_genesis_file_nocr ; genesis
dc.l create_genesis_file ; genesis crunched
dc.l save_saturn_256
dc.l save_saturn_128
dc.l save_saturn_64
dc.l save_saturn_16
dc.l save_saturn_bgr
dc.l Save_Saturn_Chr8
dc.l Save_Saturn_Chr16
;---------------------------------------------
remap_sprites
bsr do_icon
bsr create_colour_table
move.w #-2,remap_pal2
move.l sprite_list,a6
.loop cmp.l #-1,(a6)
beq .out
move.l (a6),a1
cmp.w #1,spr_mode(a1)
bne .next
move.w spr_palette(a1),d0
cmp.w #-1,d0
beq .next
move.w d0,remap_palette
move.w #25,status_mode
bsr do_status
bsr find_remap_colour_table
bsr remap_sprite_gfx
move.w #-1,spr_palette(a1)
.next addq.l #4,a6
bra .loop
.out move.w #0,status_mode
bsr do_status
bsr print_editor_sprites
rts
;---------------------------------------------
edit_palettes
bsr do_icon
bsr set_palette_menu
rts
;---------------------------------------------